package fr.gaulupeau.apps.Poche.tts.item;


import java.util.List;
import java.util.Objects;

public class TextItem extends GenericItem {

    public static class Extra {
       public enum Type {
            EMPHASIS("emphasis");

            final String type;

            Type(String type) {
                this.type = type;
            }

            public static Type getType(String type) {
                for (Type value : values()) {
                    if (value.type.equals(type)) return value;
                }
                return null;
            }
        }

        public Type type;
        public int start, end;

        Extra() {}

        public Extra(Type type, int start, int end) {
            this.type = Objects.requireNonNull(type, "type cannot be null");
            this.start = start;
            this.end = end;
        }
    }

    public String text;
    public List<Extra> extras;

    public TextItem(String text, float top, float bottom, List<Extra> extras) {
        super(top, bottom);
        this.text = text;
        this.extras = extras;
    }

}
